import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '包名',
    align:"center",
    dataIndex: 'appName'
   },
   {
    title: '版本',
    align:"center",
    dataIndex: 'version'
   },
   {
    title: '设备名称',
    align:"center",
    dataIndex: 'deviceName'
   },
   {
    title: '设备序列号',
    align:"center",
    dataIndex: 'deviceSn'
   },
   {
    title: '升级状态',
    align:"center",
    dataIndex: 'status_dictText',
    

   },
   {
    title: '发布日期',
    align:"center",
    dataIndex: 'createTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "版本",
    field: "versionId",
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"school_device_version,app_name,id"
     },
    //colProps: {span: 6},
}, {
  label: "设备",
  field: "deviceId",
  component: 'JDictSelectTag', 
  componentProps:{
    dictCode:"ss_device,device_name,id,DEVICE_TYPE='5'"
 },
  //colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '设备表id',
    field: 'deviceId',
    component: 'Input',
  },
  {
    label: 'APP版本id',
    field: 'appVersionId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  deviceId: {title: '设备表id',order: 0,view: 'text', type: 'string',},
  appVersionId: {title: 'APP版本id',order: 1,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}